import os
from lib.esign.run import RunSign
# RunSign.Messages()
#  addPerson(thirdPartyUserId,name, idNo, idType,mobile)
personAccountid=RunSign.addPerson('21112111', '庆***强', '4103*****81X', '', '')
#print("创建个人账户accountid："+personAccountid)

#创建企业账户，创建后妥善保管，后续签署使用会用到
#addOrgaccountid(thirdPartyUserId,creator,name, idNumber, idType,orgLegalIdNumber,orgLegalName)
Orgaccountid=RunSign.addOrgaccountid('21111131', personAccountid, '杭州天谷信息科技', '9133****6077', '', '', '')
#print("创建企业账户accountid："+Orgaccountid)

#通过上传方式创建文件，获取文件fileid以及uploadUrl
file=os.path.abspath(os.path.join(os.getcwd(), "../.."))+os.sep+'pdf'+os.sep+'模板1.pdf'
#print(file)
fileid=RunSign.uploadFile(file)
#print("上传文件的fileid："+fileid)

#一步发起签署接口(平台方与平台方个人客户签署)
RunSign.createFlowOneStep(fileid, personAccountid, Orgaccountid, file)